﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VinMessageBox
{
    public class VinMessageBox
    {
        public  VinMessageBox()
        { 
        }

        int _secondstoshow=50;
        string _caption;
        string _message;
        double _fadespeed;

        IWin32Window _owner=null;


        /// <summary>
        /// Gets or Sets the duration (in seconds) for which the VinMessageBox will be displayed
        /// </summary>
        public int SecondsToShow
        {
            get
            {
                return _secondstoshow;
            }
            set
            {
                  _secondstoshow = value ;
            }
        }

        /// <summary>
        /// Gets or Sets the Caption to be displayed on the VinMessageBox
        /// </summary>
        public string Caption
        {
            get
            {
                return _caption;
            }
            set
            {
                _caption = value;
            }
        }
        
        /// <summary>
        /// Gets or Sets the Message to be displayed in the VinMessageBox
        /// </summary>
        public string Message
        {
            get
            {
                return _message;
            }
            set
            {
                _message = value;
            }
        }

        /// <summary>
        /// Gets or Sets the speed in which the messagebox will Fade In and Fade Out. Value to be in the range of .1 to .5 [Double].
        /// </summary>
        public Double  FadeSpeed
        {
            get
            {
                return _fadespeed ;
            }
            set
            {
                _fadespeed  = value;
            }
        }

        /// <summary>
        /// Displays the VinMessageBox
        /// </summary>
        public void Show()
        {
            frmMsgBox frm = new frmMsgBox( this );
            frm.Text = this._caption;
            frm.Controls["lblMessage"].Text = this._message;
            frm.Show();
        }

        public void Show(IWin32Window owner)
        {
            frmMsgBox frm = new frmMsgBox(this);
            frm.Text = this._caption;
            frm.Controls["lblMessage"].Text = this._message;
            frm.ShowDialog(owner);
        }
        
    }

 


}
